typedef struct 
{
	int coef;
	int exp;
}PolyTerm;

typedef struct 
{
	PolyTerm *data;
	int length;
}SqPoly;

typedef struct PolyNode
{
	PolyTerm *data;
	struct PolyNode *next;
}PolyNode,*PolyLink;

typedef PolyLink LinkedPoly;

int SumOfPoly(PolyNode *pa,PolyNode *pb)
{
	SqPoly *pc = (SqPoly)malloc(sizeof(SqPoly));
	while(pa && pb)
	{
		if(pa -> data -> exp < pb -> data -> exp)
		{
			t = pa -> next;
			pa -> next = pc -> next;
			pc -> data -> exp = pa -> data -> exp;
			pc -> data -> coef = pa -> data -> coef;
			pc -> next = pa;
			pa = t;
		}
		
		else if(pa -> data -> exp > pb -> data -> exp)
		{
			t = pb -> next;
			pb -> next = pc -> next;
			pc -> data -> exp = pb -> data -> exp;
			pc -> data -> coef = pb -> data -> coef;
			pc -> next = pb;
			pb = t;
		}
		
		else
		{
			t = pa -> next;
			t2 = pb -> next;
			pa -> next = pc -> next;
			pc -> data -> exp = pa -> data -> exp;
			pc -> data -> coef = pa -> data -> coef;
			pc -> next = pa;
			pa = t;
			pb = t2;
		}
	}
}